#include "dog.h"

static dog_klass_info local_dog_klass = {dog_init};
dog_klass_info* dog_klass = &local_dog_klass;

static dog* dog_ctor(dog* self)
{
	((voidf)(klass_of(self)->super->ctor))(self);
	self->age = 0;
	return self;
}

void dog_init(void)
{
	if(dog_klass->init)
	{
		animal_init();
		memcpy(dog_klass, animal_klass, sizeof(animal_klass_info));
		dog_klass->super = animal_klass;
		dog_klass->name = "dog_klass";
		dog_klass->size = sizeof(dog);
		dog_klass->ctor = dog_ctor;
	}
}

int dog_get_age(dog* self)
{
	return self->age;
}

void dog_set_age(dog* self, int age)
{
	self->age = age;
}